<template>
  <demoBlock title="固定表头" padding>
    <vcu-table :columns="columns" :datas="data" :scroll="{ y: 140 }" bordered>
    </vcu-table>
  </demoBlock>
</template>

<script>
import { defineComponent, ref } from "vue";
const columns = [
  {
    title: "姓名",
    dataIndex: "name",
    key: "name",
  },
  {
    title: "年龄",
    dataIndex: "age",
    key: "age",
  },
  {
    title: "地址",
    dataIndex: "address",
    key: "address",
  },
];

let data = [...Array(100)].map((_, i) => ({
  key: i,
  name: `张三 ${i}`,
  age: 32,
  address: `火星. ${i}`,
}));
export default defineComponent({
  setup() {
    const handleAdd = (record) => {
      console.info(record);
    };
    return {
      data,
      columns,
      handleAdd,
    };
  },
});
</script>
